#ifndef SAVETHREAD_H
#define SAVETHREAD_H

#include <QThread>
#include <QMutex>
#include "savetask.h"

//此类用于任务管理执行
class SaveTask;
class SaveThread : public QThread
{
    Q_OBJECT
public:
    SaveThread(QObject *parent = nullptr);
    void run();
    void addTask(SaveTask *task);
    void stop(){ m_bStart = false;}

    SaveTask *popTask();
signals:
    void sigWorkFinish(QString);

private:
    QList<SaveTask *> m_taskList;
    QMutex m_mutex;
    bool m_bStart = true;
};

#endif // SAVETHREAD_H
